import requests
r = requests.get("http://www.baidu.com")
print (r.status_code)
print (r.encoding)
print (r.apparent_encoding)
print (r.text)
r.encoding = "utf-8"
print (r.text)

r2 = requests.head('http://www.sina.com')
print ("r2.headers:" + str(r2.headers))
print ("r2.text:" + r2.text)


kv = {'key1':'value1','key2':'value2'}
r = requests.request('GET','http://python123.io/ws',params=kv)
print(r.url)